package com.tjtt.tdm.filter;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;


import javax.servlet.FilterChain;
import javax.servlet.ServletException;
import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;
import javax.servlet.http.HttpServletRequest;

import org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter;


public class ExtendStrutsFilter extends StrutsPrepareAndExecuteFilter
{


	// 自定义的struts过滤器
	@Override
	public void doFilter(ServletRequest req, ServletResponse res, FilterChain chain) throws IOException,
	ServletException
	{
		HttpServletRequest request = (HttpServletRequest) req;
		String url = request.getServletPath();
		// 不过虑的UrlList
		List<String> notFilterUrl = new ArrayList<String>();
		notFilterUrl.add("/filemodel/saveexcel.jsp");
		notFilterUrl.add("/view/shebeiweixiu_saveguzhangdan.jsp");
		notFilterUrl.add("/workflow/yanfajiance_saveyuanshijilu.jsp");
		notFilterUrl.add("/view/planscheduleManage_saveYuedujihua.jsp");
		notFilterUrl.add("/workflow/saveYsjld.jsp");
		notFilterUrl.add("/workflow/saveYsjld2.jsp");
		notFilterUrl.add("/workflow/save_ysjl_wy.jsp");
		notFilterUrl.add("/workflow/saveHgz.jsp");
		notFilterUrl.add("/workflow/yanfajiance_savebaogao.jsp");
		notFilterUrl.add("/junyansysjl/saveLihuasqb.jsp");
		notFilterUrl.add("/junyansysjl/saveLihuabg.jsp");
		notFilterUrl.add("/junyansysjl/saveShiyanzjbg.jsp");
		
		if (notFilterUrl.contains(url))
		{
			chain.doFilter(req, res);
		}
		else
		{
			super.doFilter(req, res, chain);
		}
	}
}